package com.itzg.fileutil;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement
public class Scenario {
	public static class TotalSpec {
		public long min;
		public long limit;
		@XmlAttribute
		public long scale = 1;
		public TotalSpec() {
		}
		public TotalSpec(long min, long limit, long scale) {
			this.min = min;
			this.limit = limit;
			this.scale = scale;
		}
	}

	public static class FileSizeSpec {
		@XmlElement(name="each")
		public GaussianSpec eachFile;
		
		public TotalSpec total;

		public FileSizeSpec() {
		}
		public FileSizeSpec(GaussianSpec eachFile, TotalSpec total) {
			this.eachFile = eachFile;
			this.total = total;
		}
	}

	public static class LineLengthSpec {
		public int fixed;
	}

	public static class LineSpec {
		public LineLengthSpec length;
	}
	
	private String name;
	
	private Long seed;
	
	private LineSpec line;
	
	private GaussianSpec filesPerDir;
	
	private GaussianSpec dirsPerDir;
	
	private GaussianSpec depth;
	
	private FileSizeSpec filesize;
	
	private TotalSpec elements;
	
	public Scenario() {
	}

	public Long getSeed() {
		return seed;
	}

	public void setSeed(long seed) {
		this.seed = seed;
	}

	public LineSpec getLine() {
		return line;
	}

	public void setLine(LineSpec line) {
		this.line = line;
	}

	public GaussianSpec getFilesPerDir() {
		return filesPerDir;
	}

	public void setFilesPerDir(GaussianSpec filesPerDir) {
		this.filesPerDir = filesPerDir;
	}

	public GaussianSpec getDirsPerDir() {
		return dirsPerDir;
	}

	public void setDirsPerDir(GaussianSpec dirsPerDir) {
		this.dirsPerDir = dirsPerDir;
	}

	public GaussianSpec getDepth() {
		return depth;
	}

	public void setDepth(GaussianSpec depth) {
		this.depth = depth;
	}

	public FileSizeSpec getFilesize() {
		return filesize;
	}

	public void setFilesize(FileSizeSpec fileSize) {
		this.filesize = fileSize;
	}

	public TotalSpec getElements() {
		return elements;
	}

	public void setElements(TotalSpec files) {
		this.elements = files;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setLineLength(int len) {
		LineLengthSpec lls = new LineLengthSpec();
		lls.fixed = len;
		LineSpec ls = new LineSpec();
		ls.length = lls;
		line = ls;
	}
}
